<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

namespace app\shopuser\validate;
use think\Validate;

/**
 * 插件模型
 * @package app\admin\model
 */
class ShopUser extends Validate
{

    //定义验证规则
    protected $rule = [
        'name|商户名称' => 'require',
        'intro|简介'  => 'require',
        'address|地址'     => 'require',
        'users|负责人'  => 'require',
        'tel|手机号'   => 'regex:^1\d{10}',
        'logo|logo'   => 'require',
    ];

    //定义验证提示
    protected $message = [
        'name.require' => '请输入商户名称',
        'intro.require'    => '简介不能为空',
        'address.require'  => '邮箱格式不正确',
        'users.require' => '地址不能为空',
        'tel.regex'     => '手机号不正确',
        'logo.require'     => 'logo不能为空',
    ];
   

    //定义验证场景
    protected $scene = [
        //更新
        'update'  =>  ['name', 'intro', 'address','users','tel','logo'],
        //登录
        'signin'  =>  ['username' => 'require', 'password' => 'require'],
    ];
    
}
